{% extends "base_detail.html" %}

{% load i18n %}
{% load breadcrumbs %}
{% load region %}
{% load menu %}
{% load details %}

{% block breadcrumbs %}
    {% add_crumb 'Home' '/' %}
    {% add_crumb 'Events' 'event_list' %}
    {% add_crumb object %}
{% endblock %}

{% block objectactions %}
{% if perms.calendar.add_event %}
<li class="add"><a title="{% trans 'Add' %}" href="{% url event_add %}">{% trans 'Add' %}</a></li>
{% endif %}
{% if object.pk in obj_perms.calendar.change_event %}
<li class="edit"><a title="{% trans 'Edit' %}" href="{% url event_edit object.pk %}">{% trans 'Edit' %}</a></li>
{% endif %}
{% if object.pk in obj_perms.calendar.delete_event %}
<li class="delete"><a title="{% trans 'Delete' %}" href="{% url event_delete object.pk %}">{% trans 'Delete' %}</a></li>
{% endif %}
{% if perms.calendar.view_calendar %}
<li class="all"><a title="{% trans 'All' %}" href="{% url event_list %}">{% trans 'All' %}</a></li>
{% endif %}
{% if perms.calendar.add_event %}
<li class="import"><a title="{% trans 'Import events from an .ics file' %}" href="{% url event_import %}">{% trans 'Import' %}</a></li>
{% endif %}
{% if object.pk in obj_perms.calendar.view_event %}
<li class="export"><a title="{% trans 'Export event to an .ics file' %}" href="{% url event_export object.pk %}">{% trans 'Export' %}</a></li>
{% endif %}
{% if object.pk in obj_perms.calendar.view_event %}
{% if user not in object.stream.followers.all %}
<li class="follow"><a title="{% trans 'Follow' %}" href="{% url stream_follow object.stream request.path %}">{% trans 'Follow' %}</a></li>
{% else %}
<li class="leave"><a title="{% trans 'Leave' %}" href="{% url stream_leave object.stream request.path %}">{% trans 'Leave' %}</a></li>
{% endif %}
{% endif %}
{% endblock %}

{% block objectmenu %}{% menu "event-menu" %}{% endblock %}

{% block section %}
<div class="details">
    <table class="properties">
        {% property_table object "[['author', 'created'], ['start', 'end'], 'status', 'location', 'description', 'attendees', 'categories', 'tags']" %}
    </table>
    {% include "elements/comments.html" %}
</div>
{% endblock %}
